/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "bol_deposito", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BolDeposito.findAll", query = "SELECT b FROM BolDeposito b"),
    @NamedQuery(name = "BolDeposito.findByIdconciBanco", query = "SELECT b FROM BolDeposito b WHERE b.bolDepositoPK.idconciBanco = :idconciBanco"),
    @NamedQuery(name = "BolDeposito.findByIdrecaudaciones", query = "SELECT b FROM BolDeposito b WHERE b.bolDepositoPK.idrecaudaciones = :idrecaudaciones"),
    @NamedQuery(name = "BolDeposito.findByMonto", query = "SELECT b FROM BolDeposito b WHERE b.monto = :monto"),
    @NamedQuery(name = "BolDeposito.findByFecha", query = "SELECT b FROM BolDeposito b WHERE b.fecha = :fecha"),
    @NamedQuery(name = "BolDeposito.findByHora", query = "SELECT b FROM BolDeposito b WHERE b.hora = :hora")})
public class BolDeposito implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected BolDepositoPK bolDepositoPK;
    @Column(name = "monto")
    private Integer monto;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Column(name = "hora")
    private Integer hora;
    @JoinColumn(name = "idconci_banco", referencedColumnName = "idconci_banco", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private ConciBanco conciBanco;
    @JoinColumn(name = "idrecaudaciones", referencedColumnName = "idrecaudaciones", nullable = false, insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Recaudaciones recaudaciones;

    public BolDeposito() {
    }

    public BolDeposito(BolDepositoPK bolDepositoPK) {
        this.bolDepositoPK = bolDepositoPK;
    }

    public BolDeposito(int idconciBanco, int idrecaudaciones) {
        this.bolDepositoPK = new BolDepositoPK(idconciBanco, idrecaudaciones);
    }

    public BolDepositoPK getBolDepositoPK() {
        return bolDepositoPK;
    }

    public void setBolDepositoPK(BolDepositoPK bolDepositoPK) {
        this.bolDepositoPK = bolDepositoPK;
    }

    public Integer getMonto() {
        return monto;
    }

    public void setMonto(Integer monto) {
        this.monto = monto;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Integer getHora() {
        return hora;
    }

    public void setHora(Integer hora) {
        this.hora = hora;
    }

    public ConciBanco getConciBanco() {
        return conciBanco;
    }

    public void setConciBanco(ConciBanco conciBanco) {
        this.conciBanco = conciBanco;
    }

    public Recaudaciones getRecaudaciones() {
        return recaudaciones;
    }

    public void setRecaudaciones(Recaudaciones recaudaciones) {
        this.recaudaciones = recaudaciones;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (bolDepositoPK != null ? bolDepositoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BolDeposito)) {
            return false;
        }
        BolDeposito other = (BolDeposito) object;
        if ((this.bolDepositoPK == null && other.bolDepositoPK != null) || (this.bolDepositoPK != null && !this.bolDepositoPK.equals(other.bolDepositoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.BolDeposito[ bolDepositoPK=" + bolDepositoPK + " ]";
    }
    
}
